package com.jlkf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.jlkf.service.GisRecordService;
/**
 * 定位
 * @author DN
 *
 */
@Controller
@RequestMapping("gisRecord")
public class GisRecordController {

	@Autowired
	private GisRecordService gisRecordService;
	/**
	 * 首页查询附近的车辆
	 * @param lng 经度
	 * @param lat 纬度
	 * @param cityName 城市名称
	 * @return
	 */
	@RequestMapping("homeGetPosition")
	public Object getPosition(String lng,String lat,String cityName){
		return gisRecordService.getPosition(lng, lat, cityName);
	}
	/**
	 * 用户端  用户app主动调用 同步司机位置 
	 * @param driverId
	 * @return
	 */
	@RequestMapping("getDriverPosition")
	public Object getDriverPosition(Long driverId){
		return gisRecordService.getDriverPosition(driverId);
	}
	
	//司机端司机上传当前位置
	@RequestMapping("uploadDriverPosition")
	public Object uploadDriverPosition(@RequestBody String json){
		return gisRecordService.uploadDriverPosition(json);
	}
	
	//所有司机的
	@RequestMapping("getAllDriverPosition")
	public Object getAllDriverPosition(){
		return gisRecordService.getAllDriverPosition();
	}
	
}
